<?php  


if ($_GET['data'] && ($_GET['token'] == "doubleq")) 
	{
        	
    	$con = mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); 
        
	$data = $_GET['data'];
        
    	mysql_select_db("app_cchome", $con);
 		
        $result = mysql_query("SELECT * FROM switch");
        
    	while($arr = mysql_fetch_array($result))
        {
                if ($arr['ID'] == 1) 
                
                {
                        $state1 = $arr['state'];
                }
             	if ($arr['ID'] == 2) 
                
                {
                        $state2 = $arr['state'];
                }
            	if ($arr['ID'] == 3) 
                
                {
                        $state3 = $arr['state'];
                }
            	 if ($arr['ID'] == 4) 
                
                {
                        $state4 = $arr['state'];
                    }
                if ($arr['ID'] == 5) 
                
                {
                        $state5 = $arr['state'];
                }
           		 if ($arr['ID'] == 6) 
                
                {
                        $state6 = $arr['state'];
                }
            
        }
    
    	
    	
    
        
    	$dati = date("h:i:sa");
        
    	mysql_close($con);
        
        echo "*".$state1."".$state2."".$state3."".$state4."".$state5."".$state6."";
}
else
	{
        echo null;
        }
 
?>